package org.wechat4j.exception;

import org.wechat4j.model.Response;

/**
 * 当调用微信接口发生错误 ，抛出此异常
 *
 * @author bjliuyong
 * @version 1.0
 * @created date 16-11-14
 */
public class MpInvokeException extends Exception {

    private int errcode ;

    private String  errMsg ;

    public MpInvokeException(Response response) {
        this(response.getErrcode() , response.getErrmsg());
    }

    public MpInvokeException(int errcode, String errMsg) {
        super("errcode:" + errcode + "\terrMsg:" + errMsg );
        this.errcode = errcode ;
        this.errMsg  = errMsg  ;
    }

    public int getErrcode() {
        return errcode;
    }

    public void setErrcode(int errcode) {
        this.errcode = errcode;
    }

    public String getErrMsg() {
        return errMsg;
    }

    public void setErrMsg(String errMsg) {
        this.errMsg = errMsg;
    }

}
